﻿namespace Stopwatch.Themes
{
    using System.Windows;

    /// <summary>
    /// Represents a light/dark theme.
    /// </summary>
    public static class SystemTheme
    {
        public static Theme Current
        {
            get
            {
                string current = Application.Current.Resources["PhoneDarkThemeOpacity"].ToString();

                // Double comparisons can be scary but these are straightforward.
                switch (current)
                {
                    case "1":
                        return Theme.Dark;
                    case "0":
                        return Theme.Light;
                    default:
                        return Theme.Dark;
                }
            }
        }
    }
}
